//package cn.bonoon.util;
//
//import java.util.Date;
//
//import javax.servlet.http.HttpServletRequest;
//
//import cn.bonoon.entities.plugins.LoginEntity;
//import cn.bonoon.kernel.security.LogonUser;
//import cn.bonoon.kernel.util.RequestHelper;
//
//public final class AuthenticationHelper {
//	private AuthenticationHelper() {
//	}
//
//	public static LoginEntity loginUser(HttpServletRequest request, LogonUser bu) {
//		return loginUser(request, bu, RequestHelper.getAgent(request), true);
//	}
//
//	public static LoginEntity loginUser(HttpServletRequest request, LogonUser bu, String addinfo, boolean success) {
//		LoginEntity entity = new LoginEntity();
//		entity.setLoginsuccess(success);
//		entity.setLoginName(bu.getUsername());
//		entity.setUserName(bu.getDisplayName());
//		entity.setCreatorId(bu.getId());
//		entity.setOwnerId(bu.toOwnerId());
//		entity.setLoginAt(new Date());
//		entity.setLoginIp(RequestHelper.getIpAddress(request));
//		entity.setAdditionalInfo(addinfo);
//		return entity;
//	}
//}
